<?php echo $this->headLink(); ?>
<div class="userview">
    <table class="tableview">
        <tr>
            <td>Tiêu Đề</td>
            <td>Tóm tắt</td>
            <td>iduser</td>
            <td>idtl</td>
            <td>islt</td>
            <td>Khóa/Mở bài viết</td>
        </tr>
        <?php 
        $tin=$this->tin;
       
        foreach ($tin as $itin) {
                $user = new Zend_Session_NameSpace("user");
		if($user->level==1){
                ?>
            <tr>
                <td><?php echo $itin['tieude']; ?></td>
                <td><?php echo $itin['tomtat']; ?></td>
                <td><?php 
    //                $userModel= new Model_User;
    //                $iduser=$itin['iduser'];
    //               $getuser=$userModel->getwhereiduser($iduser);
                    echo $itin['iduser']; ?></td>
                <td><?php echo $itin['idtl']; ?></td>
                <td><?php echo $itin['idlt']; ?></td>
                <?php 
                    if ($itin['anhien']==1) {?>
                        <td><a href="<?php echo HOST_PATH; ?>/members/locknew/idtin/<?php echo $itin['idtin']; ?>">Khóa bài viết</a></td>
                    <?php }  else {
                ?>
                <td><a href="<?php echo HOST_PATH; ?>/members/unlocknew/idtin/<?php echo $itin['idtin']; ?>">Mở bài viết</a></td>
                <?php 
                }
                ?>
            </tr><?php
                } else
                {
                    if ($user->iduser==$itin['iduser']) {?>
                <tr>
                <td><?php echo $itin['tieude']; ?></td>
                <td><?php echo $itin['tomtat']; ?></td>
                <td><?php 
    //                $userModel= new Model_User;
    //                $iduser=$itin['iduser'];
    //               $getuser=$userModel->getwhereiduser($iduser);
                    echo $itin['iduser']; ?></td>
                <td><?php echo $itin['idtl']; ?></td>
                <td><?php echo $itin['idlt']; ?></td>
                <?php 
                    if ($itin['anhien']==1) {?>
                        <td><a href="<?php echo HOST_PATH; ?>/members/locknew/idtin/<?php echo $itin['idtin']; ?>">Khóa bài viết</a></td>
                    <?php }  else {
                ?>
                <td><a href="<?php echo HOST_PATH; ?>/members/unlocknew/idtin/<?php echo $itin['idtin']; ?>">Mở bài viết</a></td>
                <?php 
                }
                ?>
            </tr>
                    <?php }
                    
                    } 
        }
        ?>
    </table>
</div>
<div style='clear:both; text-align:center; '>
	<?php
		echo $this->paginationControl($this->tin,'Sliding','controlmembers.phtml');//array('idtin' => $this->idtin)
	?>
</div>